class Solution {
public:
    int MoreThanHalfNum_Solution(vector<int> numbers) {
        sort(numbers.begin(), numbers.end());
        int tmp = numbers[numbers.size() / 2];
        int num = 0;
        for (int i = 0; i < numbers.size(); i++)
        {
            if (tmp == numbers[i])
            {
                num++;
            }
        }
        if (num > numbers.size() / 2)
            return tmp;
        else
            return 0;
    }
};